//
//  PKRegisterView.m
//  PianKe
//
//  Created by ybq on 15/12/24.
//  Copyright © 2015年 B7_Young. All rights reserved.
//

#import "PKRegisterView.h"

@implementation PKRegisterView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self creatUI];
    }
    return self;
}

- (void)creatUI {
    _backButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _backButton.frame = CGRectMake(15, 10, 20, 20);
    [_backButton setImage:[UIImage imageNamed:@"back"] forState:(UIControlStateNormal)];
    [self addSubview:_backButton];
    
    _headerButton = [[UIButton alloc] initWithFrame:CGRectMake((kWidth - 60) / 2, 45, 55, 55)];
    [_headerButton setImage:[UIImage imageNamed:@"touxiang"] forState:(UIControlStateNormal)];
    UIImageView *camera = [[UIImageView alloc] initWithFrame:CGRectMake(35, 35, 20, 20)];
    camera.image = [UIImage imageNamed:@"xiangji"];
    [_headerButton addSubview:camera];
    [self addSubview:_headerButton];
    
    _maleButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _maleButton.frame = CGRectMake(kWidth / 4 - 15, kHeight / 2 - 50, 50, 25);
    [_maleButton setTitle:@"♂  男" forState:(UIControlStateNormal)];
    _maleButton.titleLabel.font = [UIFont systemFontOfSize:14];
    _maleButton.layer.cornerRadius = 12;
    _maleButton.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:_maleButton];
    
    _femaleButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _femaleButton.frame = CGRectMake(kWidth - 130, kHeight / 2 - 50, 50, 25);
    [_femaleButton setTitle:@"♀  女" forState:(UIControlStateNormal)];
    _femaleButton.titleLabel.font = [UIFont systemFontOfSize:14];
    _femaleButton.layer.cornerRadius = 12;
    _femaleButton.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:_femaleButton];
    
    _nickName = [[PKLTView alloc] initWithFrame:CGRectMake(40, kHeight - 325, kWidth - 80, 40)];
    _nickName.label.text = @"昵称:";
    [self addSubview:_nickName];
    
    _mailBox = [[PKLTView alloc] initWithFrame:CGRectMake(40, kHeight - 265, kWidth - 80, 40)];
    _mailBox.label.text = @"邮箱:";
    [self addSubview:_mailBox];
    
    _passWord = [[PKLTView alloc] initWithFrame:CGRectMake(40, kHeight - 205, kWidth - 80, 40)];
    _passWord.label.text = @"密码:";
    [self addSubview:_passWord];
    
    _doneButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _doneButton.frame = CGRectMake(40, kHeight -160, kWidth - 80, 45);
    [_doneButton setTitle:@"完成" forState:(UIControlStateNormal)];
    _doneButton.titleLabel.font = [UIFont systemFontOfSize:15];
    _doneButton.backgroundColor = [UIColor colorWithRed:120 / 255.0 green:180 / 255.0 blue:70 / 255.0 alpha:1];
    [self addSubview:_doneButton];
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 4 - 30, kHeight - 65, 180, 20)];
    label.text = @"点击“完成”按钮,代表你已阅读并同意";
    label.font = [UIFont systemFontOfSize:11];
    [self addSubview:label];
    
    _protocolButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _protocolButton.frame = CGRectMake(kWidth - 110, kHeight - 65, 55, 20);
    [_protocolButton setTitle:@"片刻协议" forState:(UIControlStateNormal)];
    [_protocolButton setTitleColor:[UIColor colorWithRed:120 / 255.0 green:180 / 255.0 blue:70 / 255.0 alpha:1] forState:(UIControlStateNormal)];
    _protocolButton.titleLabel.font = [UIFont systemFontOfSize:11];
    [self addSubview:_protocolButton];
    
    
}
@end
